{% extends './views/layout/layout.html' %}

{% from "./views/macros/pagination.html" import pagination %}

{% block head %}
<link rel="stylesheet" href="/public/css/list.css" />
{% endblock %}

{% block main %}

<div class="main">
  <div class="container">
    <div class="list-box">
      <div class="h">
        <h2 class="title">{{category.name}}</h2>
      </div>
      <div class="c clearfix">
        <ul class="list clearfix">
          {% for item in items %}
          <li class="item">
            <div class="figure">
              <a href="/detail/{{item.id}}">
                <img src="/public/images/{{item.cover}}" alt="" />
              </a>
            </div>
            <h3 class="title">
              <a href="/detail/{{item.id}}"> {{item.name}} </a>
              <p class="price"><span class="num">{{item.price}}</span>元</p>
            </h3>
            <p class="desc">{{item.description}}</p>
          </li>
          {%endfor%}
        </ul>
      </div>
    </div>

    <div class="container">
      <!-- 分页器 -->
      {% set url = "/list/"+category.id %}
      {{ pagination(url,pageNum,pageSize,count) }}
    </div>
  </div>
</div>
{% endblock %}
